package com.linwen.excise.niuke._40;

import java.util.Scanner;

/**
 * @author wlw
 * @date 2023/3/5 1:27 PM
 */
public class _22汽水瓶 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()){
            int n = scanner.nextInt();
            function1(n);
            function2(n);
        }
    }

    private static void function2(int n) {
        if(n==0){
            return;
        }
        System.out.println(n/2);
    }

    private static void function1(int n) {
        int count = 0;
        int temp = 0;
        int result = 0;
        if(n==0){
            return;
        }
        if(n<3){
            System.out.println(0);
        }
        do{
            count = n/3;
            temp = n%3;
            result += count;
            n = count+temp;

        }while (n>2);
        if(n==2){
            result++;
        }
        System.out.println(result);
    }
}
